package com.matrix.java.chap_03.example;

import java.util.Scanner;

public class Case3_08 {
    public static void main(String[] args) {
        int randomNum = (int) (Math.random() * 100);
        System.out.println(randomNum);
        Scanner input = new Scanner(System.in);
        System.out.print("输入: ");
        int num = input.nextInt();
        NumberOP numberOP = new NumberOP();
        if (randomNum == num) {
            System.out.println(10000);
        } else if (numberOP.getDigits(randomNum) == numberOP.getTens(num)
                && numberOP.getTens(randomNum) == numberOP.getDigits(num)) {
            System.out.println(3000);
        } else if (numberOP.getDigits(randomNum) == numberOP.getTens(num)
                || numberOP.getDigits(randomNum) == numberOP.getDigits(num)
                || numberOP.getTens(randomNum) == numberOP.getDigits(num)
                || numberOP.getTens(randomNum) == numberOP.getTens(num)) {
            System.out.println(1000);
        } else {
            System.out.println("cai");
        }
        input.close();

    }

}

class NumberOP {
    public int getDigits(int num) {
        int digits = num % 10;
        return digits;
    }

    public int getTens(int num) {
        int tens = num / 10;
        return tens;
    }
}

